package com.mdd.admin.validate.user;

import com.mdd.admin.validate.BaseParam;
import com.mdd.common.validator.annotation.IntegerContains;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class UserPointsUpdateParam extends BaseParam {

    @NotNull(message = "userId参数缺失", groups = {create.class, update.class})
    private Integer userId;

    @NotNull(message = "userPoints参数缺失", groups = {create.class, update.class})
    private BigDecimal userPoints;

    @NotNull(message = "changePoints参数缺失", groups = {create.class, update.class})
    @DecimalMax(value = "99999999.99", message= "额度不能超过99999999.99", groups = {create.class, update.class})
    private BigDecimal changePoints;

    @NotNull(message = "changeType参数缺失", groups = {BaseParam.create.class, BaseParam.update.class})
    @IntegerContains(values = {200, 201}, message = "不是合法的取值范围")
    private Integer changeType;
//    @NotNull(message = "action参数缺失", groups = {BaseParam.create.class, BaseParam.update.class})
//    @IntegerContains(values = {1, 0}, message = "action参数值不在符合范围", groups = {BaseParam.create.class, BaseParam.update.class})
//    private Integer action;

    private String remark;

}
